module EventEditor
  module Route
    class MoveSelectionDialog
     def self.show(base, &func)
       dialog = Gtk::Dialog.new("Wait Frames",
               base,
               Gtk::Dialog::MODAL |
               Gtk::Dialog::DESTROY_WITH_PARENT,
               ["OK", Gtk::Dialog::RESPONSE_OK],
               ["Cancel", Gtk::Dialog::RESPONSE_CANCEL]
               )

        hbox = Gtk::HBox.new
        hbox.set_border_width(5)

        dialog.vbox.add(hbox)
        dialog.vbox.show_all

        # run
        dialog.run do |response|
          if response == Gtk::Dialog::RESPONSE_OK
            func.call(wait_input.value.floor)
          else
            func.call(:cancel)
          end
          dialog.destroy
        end
      end
    end
  end
end